/*
 * Copyright : (C) 2022 Phytium Information Technology, Inc.
 * All Rights Reserved.
 *
 * This program is OPEN SOURCE software: you can redistribute it and/or modify it
 * under the terms of the Phytium Public License as published by the Phytium Technology Co.,Ltd,
 * either version 1.0 of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,but WITHOUT ANY WARRANTY;
 * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 * See the Phytium Public License for more details.
 *
 *
 * FilePath: ftrace.h
 * Date: 2022-06-09 16:35:50
 * LastEditTime: 2022-06-09 16:35:51
 * Description:  This file is for trace macro definition
 *
 * Modify History:
 *  Ver   Who        Date         Changes
 * ----- ------     --------    --------------------------------------
 * 1.0   zhugengyu  2022/6/13    first release
 */
#ifndef FTRACE_H
#define FTRACE_H

/***************************** Include Files *********************************/
#include "rk_parameters.h"

#ifdef __cplusplus
extern "C"
{
#endif

/************************** Constant Definitions *****************************/

/**************************** Type Definitions *******************************/

/***************** Macros (Inline Functions) Definitions *********************/
#if defined(LOSCFG_DEBUG_PRINT_UART0)
#define FTRACE_UART_TXD_PAD_REG0   0x32B301D0UL
#define FTRACE_UART_TXD_PAD_FUNC   0x00000044UL
#define FTRACE_UART_BASE           0x2800C000UL
#elif defined(LOSCFG_DEBUG_PRINT_UART1)
#define FTRACE_UART_TXD_PAD_REG0   0x32B300B4UL
#define FTRACE_UART_TXD_PAD_FUNC   0x00000040UL
#define FTRACE_UART_BASE           0x2800D000UL
#elif defined(LOSCFG_DEBUG_PRINT_UART2)
#define FTRACE_UART_TXD_PAD_REG0   0x32B300DCUL
#define FTRACE_UART_TXD_PAD_FUNC   0x00000040UL
#define FTRACE_UART_BASE           0x2800E000UL
#elif defined(LOSCFG_DEBUG_PRINT_UART3)
#define FTRACE_UART_TXD_PAD_REG0   0x32B3020CUL
#define FTRACE_UART_TXD_PAD_FUNC   0x00000042UL
#define FTRACE_UART_BASE           0x2800F000UL
#else
#error "The trace log output port is not specified!"
#endif

#define FTRACE_UART_DR      (FTRACE_UART_BASE + 0x00U) /* UART数据寄存器 */
#define FTRACE_UART_FR      (FTRACE_UART_BASE + 0x18U) /* UART状态寄存器 */
#define FTRACE_UART_IBRD    (FTRACE_UART_BASE + 0x24U) /* UART波特率整数值寄存器 */
#define FTRACE_UART_FBRD    (FTRACE_UART_BASE + 0x28U) /* UART波特率小数值寄存器 */
#define FTRACE_UART_LCR_H   (FTRACE_UART_BASE + 0x2CU) /* UART线控寄存器 */
#define FTRACE_UART_CR      (FTRACE_UART_BASE + 0x30U) /* UART控制寄存器 */

/************************** Function Prototypes ******************************/

/************************** Variable Definitions *****************************/

/*****************************************************************************/

#ifdef __cplusplus
}
#endif

#endif